package com.jinzhu.pojo;

import lombok.Data;

@Data
public class Result {
    private String code;
    private String message;
    private Object data;

    public static Result success(){
        Result result = new Result();
        result.setCode("1");
        result.setMessage("success成功");
        return result;
    }
    public static Result success(Object data){
        Result result = new Result();
        result.data = data;
        result.code="1";
        result.setMessage("success成功");
        return result;
    }
    public static Result error(){
        Result result = new Result();
        result.setCode("0");
        result.setMessage("error失败");
        return result;
    }
    public static Result error(String message){
        Result result = new Result();
        result.setCode("0");
        result.setMessage(message);
        return result;
    }

}
